<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!-- vue js库-->
    <script src="./vue.js"></script>
</head>
<body>

<!--vue 绑定点击事件 -->

<div id="app-5">
    <p>{{ message }}</p>
    <button v-on:click="reverseMessage">反转消息</button>
</div>

<script>
    var app5 = new Vue({
        el: '#app-5',
        data: {
            message: 'Hello Vue.js!'
        },
        methods: {
            reverseMessage: function () {

                //ES5的api
                console.log(this.message.split(''))
                console.log(this.message.split('').reverse())

                this.message = this.message.split('').reverse().join('')
            }
        }
    })


    const data='鲁大师';

    console.log(data.split(''))
    console.log(data.split('').reverse())


    /*  将数组元素转换为字符串：  join
    * join() 默认 ,  分割
    * join('') 字符不分割
    * join('-')  字符横杠分割 */

    console.log(data.split('').reverse().join('-'))

</script>

</body>
</html>